package com.ruoyi.yyq.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yyq.mapper.CarMerchantBalanceMapper;
import com.ruoyi.yyq.domain.CarMerchantBalance;
import com.ruoyi.yyq.service.ICarMerchantBalanceService;

/**
 * 商家余额Service业务层处理
 * 
 * @author 尹永青
 * @date 2025-05-14
 */
@Service
public class CarMerchantBalanceServiceImpl implements ICarMerchantBalanceService 
{
    @Autowired
    private CarMerchantBalanceMapper carMerchantBalanceMapper;

    /**
     * 查询商家余额
     * 
     * @param balanceId 商家余额主键
     * @return 商家余额
     */
    @Override
    public CarMerchantBalance selectCarMerchantBalanceByBalanceId(Long balanceId)
    {
        return carMerchantBalanceMapper.selectCarMerchantBalanceByBalanceId(balanceId);
    }

    /**
     * 查询商家余额列表
     * 
     * @param carMerchantBalance 商家余额
     * @return 商家余额
     */
    @Override
    public List<CarMerchantBalance> selectCarMerchantBalanceList(CarMerchantBalance carMerchantBalance)
    {
        return carMerchantBalanceMapper.selectCarMerchantBalanceList(carMerchantBalance);
    }

    /**
     * 新增商家余额
     * 
     * @param carMerchantBalance 商家余额
     * @return 结果
     */
    @Override
    public int insertCarMerchantBalance(CarMerchantBalance carMerchantBalance)
    {
        return carMerchantBalanceMapper.insertCarMerchantBalance(carMerchantBalance);
    }

    /**
     * 修改商家余额
     * 
     * @param carMerchantBalance 商家余额
     * @return 结果
     */
    @Override
    public int updateCarMerchantBalance(CarMerchantBalance carMerchantBalance)
    {
        return carMerchantBalanceMapper.updateCarMerchantBalance(carMerchantBalance);
    }

    /**
     * 批量删除商家余额
     * 
     * @param balanceIds 需要删除的商家余额主键
     * @return 结果
     */
    @Override
    public int deleteCarMerchantBalanceByBalanceIds(Long[] balanceIds)
    {
        return carMerchantBalanceMapper.deleteCarMerchantBalanceByBalanceIds(balanceIds);
    }

    /**
     * 删除商家余额信息
     * 
     * @param balanceId 商家余额主键
     * @return 结果
     */
    @Override
    public int deleteCarMerchantBalanceByBalanceId(Long balanceId)
    {
        return carMerchantBalanceMapper.deleteCarMerchantBalanceByBalanceId(balanceId);
    }

    @Override
    public CarMerchantBalance selectCarMerchantBalanceByMid(Long mid) {
        return carMerchantBalanceMapper.selectCarMerchantBalanceByMid(mid);
    }
}
